package com.wwj.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @GetMapping("hello")
    @PreAuthorize("hasAuthority('test')")
    public String hello(){
        return  "hello";
    }

    @GetMapping("hello1")
    //@PreAuthorize("hasAuthority('admin')")
    @PreAuthorize("@ex.hasAuthority('admin')")
    public String hello1(){
        return  "hello1";
    }

    @GetMapping("hello2")
    public String hello2(){
        return  "hello2";
    }

}
